from django.contrib import admin

# Register your models here.
import xadmin
from .models import *




class SchoolAdmin(object):
    list_display = ("number","name","linkman","phone","site","classify",'area','create_timestamp','last_edit')
    search_fields =("number","name","site","linkman","phone")
    list_filter = ("number","name","site","linkman","phone")

class XYW(object):
    list_display = ("dis_num","name2",'XYW_hjjd',"XYW_IP","XYW_hlA",'XYW_hlB',"XYW_gateway",'last_edit')
    search_fields =("name2__name","name2__number",'XYW_hjjd',"XYW_IP","XYW_gateway","XYW_pw")
    list_filter = ("name2__name","name2__number",'XYW_hjjd',"XYW_IP","XYW_gateway","XYW_pw")

xadmin.site.register(School, SchoolAdmin)
xadmin.site.register(XYW_IP, XYW)


from xadmin.views.website import LoginView
class LoginViewAdmin(LoginView):
    title = '信息管理系统'

xadmin.site.register(LoginView, LoginViewAdmin)
from xadmin import views                # 导入xadmin的views

class BasdSetting(object):              # 主题管理器
    enable_themes = True                # 使用主题
    use_bootswatch = True
xadmin.site.register(views.BaseAdminView, BasdSetting)      # 将主题管理器绑定views.BaseAdminView注册


class GlobalSettings(object):
    # 头部系统名称和底部版权管理器
    title = '信息管理系统'
    site_title = '信息管理系统'                              # 头部系统名称
    site_footer = 'CCIP-Ma'             # 底部版权
    menu_style = 'accordion'                                # 设置数据管理导航折叠，以每一个app为一个折叠框
xadmin.site.register(views.CommAdminView, GlobalSettings)   # 头部系统名称和底部版权管理器绑定views.CommAdminView注册

